<?php
namespace Home\Controller;
use Think\Controller;
class ShareController extends Controller {
    public function index(){
    	$nonceStr=createNonceStr();
    	$jsapi_ticket=getJsApiTicket();
    	$time=time();
    	$url="http://".$_SERVER['SERVER_NAME'].__SELF__;
    	$string1="jsapi_ticket=".$jsapi_ticket."&noncestr=".$nonceStr."&timestamp=".$time."&url=".$url;
    	echo "$string1";
    	$signature=sha1($string1);
    	$data=array(
    		'appid'=>APPID,
    		'timestamp'=>$time,
    		'nonceStr'=>$nonceStr,
    		'signature'=>$signature,
    		'url'=>$url,
    	);
    	$this->assign($data);
        $this->display();
   }
}